package com.shawn.spring.boot.redis.entity;

import javax.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.joda.money.Money;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;

/**
 * @author shawn
 * @since 2020/9/4
 */
@RedisHash(value = "coffee", timeToLive = 60)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CoffeeCacheEntity {

  @Id
  private Long id;
  @Indexed
  private String name;
  private Money price;
}
